<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>

</body>
</html>
<script>
    var str = "https://totheglory.im/t/654193/?id=654193";
    var index = str.lastIndexOf("/");
    console.log(index)
    str = str.substring(0, index - 2);
    console.log(str)


    const list = ['https://chdbits.co/details.php', 'https://ptchdbits.co/details.php']
    console.log('https://chdbits.co/detail.php?id=1'.indexOf(JSON.stringify(list)))

    const url = 'https://totheglory.im/t/655924/?id=655924'
    console.log(url.split('655924')[0])
</script>
